#pragma once

typedef HANDLE uae_sem_t;
typedef HANDLE uae_thread_id;

void uae_sem_destroy(uae_sem_t*);
int uae_sem_trywait(uae_sem_t*);
void uae_sem_post(uae_sem_t*);
void uae_sem_wait(uae_sem_t* t);
void uae_sem_init(uae_sem_t*, int manual_reset, int initial_state);
int uae_start_thread(const TCHAR* name, void*(*f)(void*), void* arg, uae_thread_id* thread);
int uae_start_thread_fast(void*(*f)(void*), void* arg, uae_thread_id* thread);
void uae_end_thread(uae_thread_id* thread);
void uae_set_thread_priority(uae_thread_id*, int);

void uae_wait_thread(uae_thread_id tid);